package com.henry.db.migrate.main;

import com.henry.db.migrate.util.RandomValueUtil;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.Random;
import java.util.UUID;

public class TestRandom {
    public static void main(String[] args){
//        Random random = new Random(2);
//        for (int i = 0; i < 100; i++) {
//            System.out.println(random.nextInt());
//        }
        Random random = new Random();
        DecimalFormat df=new DecimalFormat("#.000");
        String format = df.format(random.nextDouble() * 1000000000000000L);
        System.out.println(format);
//        Double d1 = Double.valueOf(format);
        BigDecimal decimal = new BigDecimal(format);
        System.out.println(decimal);


    }

    private static Object getColumnVal(int j){
        Random random = new Random();
        DecimalFormat df=new DecimalFormat("#.000");
        if(j%5==1)
            return UUID.randomUUID().toString();
        else if(j%5==2)
            return random.nextInt(65535);
        else if(j%5==3)
            return RandomValueUtil.getChineseName()+RandomValueUtil.getEmail(8,32);
        else if(j%5==4)
            return new Date();
        else
            return  Double.valueOf(df.format(random.nextDouble()*10000000000000000L));
    }
}
